/**
 * 表单验证
 * 
 * @param {Object} rules 验证字段的规则
 * @param {Object} messages 验证字段的提示信息
 * 
 */
import basic from './basic.js';
var actmodel = new basic();
actmodel.do = "sys_advert"
actmodel.getdata = function (op,type) {
  var app = getApp();
  if(!op)
  {
    op="bananer"
  }
  if(!type)
  {
    type="coupon"
  }
  var data = { op,type }
 
  return new Promise((resolve, reject) => {
    app.util.request({
      'url': 'entry/wxapp/' + actmodel.do,
      'data': data,
      'method': "get",
      showLoading: false,
      success: function (res) {
        if (res.data.errno == 0) {
                     
          resolve(res.data.data);
        }
        reject(res.data.message);
      },
      fail: function (res) {
        reject(((res.data && res.data.message) ? res.data.message : res.errMsg));
      },
      complete: function () {
      }
    });
  });
} 
module.exports = actmodel;